<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of ContactMailer
 *
 * @author dejo
 */
class Tc_ContactMailer {
    static function send($values) {
        $contactFormEmail = Zend_Registry::get('contactForm');

        $mail = new Zend_Mail();
        $mail->setSubject("Vraag vanuit de website");

        $body = "Naam: " . $values['naam'] . PHP_EOL;
        $body .= "Email: " . $values['email']. PHP_EOL;
        if(!$values['telefoon']) {
            "Telefoon: " . $values['telefoon']. PHP_EOL;
        }
        if(!$values['website']) {
            "Website: " . $values['website']. PHP_EOL;
        }
        $body .= "Vraag: " . $values['bericht']. PHP_EOL;
        $mail->setFrom($values['email'], $values['naam']);
        $mail->setBodyText($body);
        $mail->addTo($contactFormEmail);
        try {
            $mail->send();
        }catch(Exception $e) {

        }

    }
}
?>
